package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

public class GoodsEvaluateCountRequest extends Request {

	private int goodsId;
	
	/**套餐id*/
	private Integer mealId;
	
	public GoodsEvaluateCountRequest() {
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		this.goodsId = requestInfo.getIntParameter(ApiUrlParamEnum.goodsId.getParamName(), 0);
		this.mealId = requestInfo.getIntParameter(ApiUrlParamEnum.mealId.getParamName(), 0);
		if ( goodsId < 1 && mealId < 1) {
			throw new RequestIllegalException("error goodsId or mealId: " + goodsId + ","+mealId);
		}
		
	}

	public int getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(int goodsId) {
		this.goodsId = goodsId;
	}

	public Integer getMealId() {
		return mealId;
	}

	public void setMealId(Integer mealId) {
		this.mealId = mealId;
	}
	
}
